#ifndef __TYPE_DEFINE_HPP__
#define __TYPE_DEFINE_HPP__

typedef signed char         INT8, *PINT8;
typedef signed short        INT16, *PINT16;
typedef signed int          INT32, *PINT32;
typedef signed long long    INT64, *PINT64;
typedef unsigned char       UINT8, *PUINT8;
typedef unsigned short      UINT16, *PUINT16;
typedef unsigned int        UINT32, *PUINT32;
typedef unsigned long long  UINT64, *PUINT64;
typedef UINT32              LIBVERSION;
typedef void*               HNETHANDLE;
typedef void*               HSESSION;
typedef void*               HDBHANDLE;
typedef void*               HTIMER;

#ifndef NULL
#ifdef __cplusplus
#define NULL    0
#else
#define NULL    ((void *)0)
#endif
#endif

#ifdef WIN32
#include <WinSock2.h>
#else
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
typedef INT32   SOCKET;
typedef void*   HANDLE;
#endif

#define MAKEVERSION(b1, b2, b3, b4) \
    ((LIBVERSION)(((UINT8)(b1))|(((LIBVERSION)((UINT8)(b2)))<<8)|(((LIBVERSION)((UINT8)(b3)))<<16)|(((LIBVERSION)((UINT8)(b4)))<<24)))
#endif
